#include<stdio.h>
int main()
{
    int a,b,c;
    scanf("%d %d",&a,&b);
    int t,l,A,B;
    A=a;
    B=b;
    if(a<b)
    {
        c=a;
        a=b;
        b=c;
    }
    while(b!=0)
    {
        t=a%b;
        a=b;
        b=t;
    }
    l=(A*B)/a;
    printf("%d %d",a,l);
    return 0;
}
